package com.jacklin.account.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jacklin.account.domain.Account;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;

/**
 * @author: jacklin
 * @since: 2022/3/24 17:22
 */
@Mapper
public interface AccountMapper extends BaseMapper<Account> {

    /**
     * 扣减账户金额
     *
     * @author: jacklin
     * @date: 2022/3/26 14:26
     **/
    void decreaseAccount(@Param("balance") BigDecimal balance);

    /**
     *
     * @author: jacklin
     * @date: 2022/8/4 11:00
     **/
    Boolean decrease(Integer userId, Integer accountId, BigDecimal money);

}
